<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>详情页</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		<style type="text/css">
			body {
				background: #FFF;
			}

			#app {
				padding-top: 44px;
			}

			.top {
				width: 100%;
				height: 21.9rem;
				background: #fff;
				padding: 0.8rem 1.8rem 2rem;
			}

			.middle {
				margin-bottom: 5rem;
			}

			.mui-slider {
				height: 13.5rem;
			}

			.content-list {
				/* padding-bottom: 1.2rem; */
				width: 100%;
				background: #fff;
			}

			.content-list::after {
				content: '';
				clear: both;
				display: block;
			}

			.content-list-title {
				font-size: 1.6rem;
				font-family: PingFang SC;
				font-weight: 600;
				line-height: 1.6rem;
				color: #333333;
				padding-left: 4.8rem;
				position: relative;
				border-bottom: 0.1rem solid #E3E3E3;
				padding-bottom: 1.2rem;
			}

			.content-list-title a {
				font-size: 1.2erem;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
				float: right;
				margin-right: 1.8rem;
			}

			.content-list-title::before {
				content: '';
				display: inline-block;
				width: 2rem;
				height: 2rem;
				position: absolute;
				left: 1.8rem;
				top: 50%;
				margin-top: -1.5rem;
			}

			.peixun .content-list-area .list .list-area {
				padding: 2rem 1.8rem 1.3rem;
				margin-bottom: 5.6rem;
			}

			.peixun .content-list-area .list .user {
				font-size: 1.6rem;
				font-family: PingFangSC;
				font-weight: 400;
				color: #666666;
				display: flex;
				justify-content: flex-start;
				align-items: center;
			}

			.peixun .content-list-area .list .user ul {
				padding-left: 0;
			}

			.peixun .content-list-area .list .user ul li {
				list-style-type: none;
			}

			.peixun .content-list-area .list .user img {
				width: 3rem;
				height: 3rem;
				vertical-align: middle;
				margin-right: 1rem;
			}

			.peixun .content-list-area .list h3 {
				font-size: 1.7rem;
				font-family: PingFangSC;
				font-weight: 400;
				color: #333333;
				line-height: 3rem;
				margin-bottom: 10px;
			}

			.peixun .content-list-area .list h2.title {
				font-weight: bold !important;
			}

			.peixun .content-list-area .list .pictures img {
				width: 10.9rem;
				height: 10.9rem;
			}

			.peixun .content-list-area .list .operate {
				width: 100%;
				height: 4.6rem;
				display: flex;
				justify-content: space-around;
				align-items: center;
				font-size: 1.2rem;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FC6A02;
				position: fixed;
				border-top: 0.1rem solid #e2e2e2;
				bottom: 0;
				background: #fff;
			}

			.peixun .content-list-area .list .orangeWords {
				color: #FC6A02;
			}

			.peixun .content-list-area .list .operate img {
				width: 1.5rem;
				height: 1.5rem;
				vertical-align: text-top;
				margin-right: 0.1rem;
			}

			.peixun .content-list-area .list .operate .operate-list {
				width: 50%;
				text-align: center;
				position: relative;
			}

			.peixun .content-list-area .list .operate .operate-list:first-child::after {
				content: '';
				display: inline-block;
				width: 0.1rem;
				height: 1.8rem;
				background: #E3E3E3;
				position: absolute;
				right: 0;
				top: 50%;
				margin-top: -0.9rem;
			}

			/* 图片预览代码 */
			.mui-preview-image.mui-fullscreen {
				position: fixed;
				z-index: 20;
				background-color: #000;
				height: auto;
			}

			.mui-preview-header,
			.mui-preview-footer {
				position: absolute;
				width: 100%;
				left: 0;
				z-index: 10;
			}

			.mui-preview-header {
				height: 44px;
				top: 0;
			}

			.mui-preview-footer {
				height: 50px;
				bottom: 0px;
			}

			.mui-preview-header .mui-preview-indicator {
				display: block;
				line-height: 25px;
				color: #fff;
				text-align: center;
				margin: 15px auto 4;
				width: 70px;
				background-color: rgba(0, 0, 0, 0.4);
				border-radius: 12px;
				font-size: 16px;
			}

			.mui-preview-image {
				display: none;
				-webkit-animation-duration: 0.5s;
				animation-duration: 0.5s;
				-webkit-animation-fill-mode: both;
				animation-fill-mode: both;
			}

			.mui-preview-image.mui-preview-in {
				-webkit-animation-name: fadeIn;
				animation-name: fadeIn;
			}

			.mui-preview-image.mui-preview-out {
				background: none;
				-webkit-animation-name: fadeOut;
				animation-name: fadeOut;
			}

			.mui-preview-image.mui-preview-out .mui-preview-header,
			.mui-preview-image.mui-preview-out .mui-preview-footer {
				display: none;
			}

			.mui-zoom-scroller {
				position: absolute;
				display: -webkit-box;
				display: -webkit-flex;
				display: flex;
				-webkit-box-align: center;
				-webkit-align-items: center;
				align-items: center;
				-webkit-box-pack: center;
				-webkit-justify-content: center;
				justify-content: center;
				left: 0;
				right: 0;
				bottom: 0;
				top: 0;
				width: 100%;
				height: 100%;
				margin: 0;
				-webkit-backface-visibility: hidden;
			}

			.mui-zoom {
				-webkit-transform-style: preserve-3d;
				transform-style: preserve-3d;
			}

			.mui-slider .mui-slider-group .mui-slider-item img {
				width: auto;
				height: auto;
				max-width: 100%;
				max-height: 100%;
			}

			.mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
				width: 100%;
			}

			.mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
				display: inline-table;
			}

			.mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
				display: table-cell;
				vertical-align: middle;
			}

			.mui-preview-loading {
				position: absolute;
				width: 100%;
				height: 100%;
				top: 0;
				left: 0;
				display: none;
			}

			.mui-preview-loading.mui-active {
				display: block;
			}

			.mui-preview-loading .mui-spinner-white {
				position: absolute;
				top: 50%;
				left: 50%;
				margin-left: -25px;
				margin-top: -25px;
				height: 50px;
				width: 50px;
			}

			.mui-preview-image img.mui-transitioning {
				-webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
				transition: transform 0.5s ease, opacity 0.5s ease;
			}

			@-webkit-keyframes fadeIn {
				0% {
					opacity: 0;
				}

				100% {
					opacity: 1;
				}
			}

			@keyframes fadeIn {
				0% {
					opacity: 0;
				}

				100% {
					opacity: 1;
				}
			}

			@-webkit-keyframes fadeOut {
				0% {
					opacity: 1;
				}

				100% {
					opacity: 0;
				}
			}

			@keyframes fadeOut {
				0% {
					opacity: 1;
				}

				100% {
					opacity: 0;
				}
			}

			p img {
				max-width: 100%;
				height: auto;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-closeempty mui-pull-left"></a>
			<h1 class="mui-title">详情页</h1>
		</header>
		<div id="app" v-cloak>

			<!-- 内容区域 -->
			<div class="middle">

				<!-- 培训拼团 -->
				<div class="content-list peixun">
					<div class="content-list-area">
						<div class="list">
							<div class="list-area">
								<h2 class="title">{{detail.title}}</h2>
								<div class="user" v-if="detail.user_info">
									<img :src="detail.department_image" alt="">
									<div>
										<ul>
											<li>{{detail.department_name}}</li>
											<li>{{detail.createtime}}</li>
										</ul>
									</div>
								</div>
								<h3>{{detail.content}}</h3>
								<img style="width: 100%;" style="margin-bottom: 0.9375rem;" :src="it" v-for="it in detail.images" data-preview-src="" :data-preview-group="1">
								<template v-if="detail.videofile">
									<video width="100%" height="" v-for="item in detail.videofile" :src="item" controls style="margin-bottom: 0.9375rem;">
										当前浏览器不支持 video直接播放
									</video>
								</template>
								
							</div>
							<div class="operate">
								<div class="operate-list">
									<img src="images/d01.png" alt="">{{detail.votesnumber}}
								</div>
								<div class="operate-list orangeWords">
									<img src="images/d02.png" alt="">{{detail.goodnumber}}
								</div>
							</div>
						</div>
					</div>
				</div>


			</div>

		</div>

		<script src="js/mui.js"></script>
		<script src="js/vue.js"></script>
		<script src="js/mui.zoom.js"></script>
		<script src="js/mui.previewimage.js"></script>
		<script type="text/javascript">
			var app = new Vue({
				el: '#app',
				data: {
					id: "",
					detail: {},
				},
				methods: {
					getDetail: function() {
						$get("/api/news/getactivityinfo", {
							id: this.id
						}, function(res) {
							app.detail = res
							app.detail.createtime = app.format(app.detail.createtime)
							app.$nextTick(function() {
								mui.previewImage();
							})
						})
					},
					format: function(shijianchuo) {
						//shijianchuo是整数，否则要parseInt转换
						var time = new Date(shijianchuo);
						var y = time.getFullYear();
						var m = time.getMonth() + 1;
						var d = time.getDate();
						var h = time.getHours();
						var mm = time.getMinutes();
						var s = time.getSeconds();
						return y + '-' + add0(m) + '-' + add0(d) + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s);
					}
				},

				created: function() {

				},
				mounted: function() {
					mui.init()
					this.id = getQueryString("id");
					this.getDetail()
				}
			})
			function add0(m){return m<10?'0'+m:m }
		</script>
	</body>

</html>
